#define _OSTREE_METADATA_GPGSIGS_NAME "ostree.gpgsigs"
#define _OSTREE_METADATA_GPGSIGS_TYPE G_VARIANT_TYPE ("aay")
+static inline gboolean
+_ostree_repo_mode_is_bare (OstreeRepoMode mode)
+{
+ return
+ mode == OSTREE_REPO_MODE_BARE ||
+ mode == OSTREE_REPO_MODE_BARE_USER;
+}
+
GVariant *
_ostree_detached_metadata_append_gpg_sig (GVariant *existing_metadata,
GBytes *signature_bytes);
GError **error)
{
HardlinkResult ret_result = HARDLINK_RESULT_NOT_SUPPORTED;
- int srcfd = (self->mode == OSTREE_REPO_MODE_BARE || self->mode == OSTREE_REPO_MODE_BARE_USER) ?
+ int srcfd = _ostree_repo_mode_is_bare (self->mode) ?
self->objects_dir_fd : self->uncompressed_objects_dir_fd;
again:
goto out;
}
- if (objtype == OSTREE_OBJECT_TYPE_FILE && (self->mode == OSTREE_REPO_MODE_BARE ||
- self->mode == OSTREE_REPO_MODE_BARE_USER))
+ if (objtype == OSTREE_OBJECT_TYPE_FILE && _ostree_repo_mode_is_bare (self->mode))
{
/* To satisfy tools such as guile which compare mtimes
* to determine whether or not source files need to be compiled,
* binary with trailing garbage, creating a window on the local
* system where a malicious setuid binary exists.
*/
- if ((repo_mode == OSTREE_REPO_MODE_BARE || repo_mode == OSTREE_REPO_MODE_BARE_USER) && temp_file_is_regular)
+ if ((_ostree_repo_mode_is_bare (repo_mode)) && temp_file_is_regular)
{
guint64 size = g_file_info_get_size (file_info);
if ((self->mode == OSTREE_REPO_MODE_ARCHIVE_Z2
&& strcmp (dot, ".filez") == 0) ||
- ((self->mode == OSTREE_REPO_MODE_BARE || self->mode == OSTREE_REPO_MODE_BARE_USER)
+ ((_ostree_repo_mode_is_bare (self->mode))
&& strcmp (dot, ".file") == 0))
objtype = OSTREE_OBJECT_TYPE_FILE;
else if (strcmp (dot, ".dirtree") == 0)
{
char loose_path_buf[_OSTREE_LOOSE_PATH_MAX];
- g_assert (self->mode == OSTREE_REPO_MODE_BARE ||
- self->mode == OSTREE_REPO_MODE_BARE_USER);
+ g_assert (_ostree_repo_mode_is_bare (self->mode));
_ostree_loose_path (loose_path_buf, checksum, OSTREE_OBJECT_TYPE_FILE, self->mode);